public class Demo03 {
    public static void main(String[] args) {
        /**
         * 运算符 + - * / % ++ --
         */
        int a = 10;
        int b = 20;
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);
        System.out.println(a%b);
        System.out.println(a++);
        System.out.println(a--);
        System.out.println(a);
        System.out.println(b);


        System.out.println("hello"+1+2); //hello12
        System.out.println(1+2+"hello"); //3hello
        System.out.println(1+2+"hello"+3+4);//3hello34


        int c = 34;
        //获取c这个数据中的十位
        System.out.println(c/10);
        //获取c这个数据中的个位
        System.out.println(c%10);

        int d = 10;
        d++; //d = d + 1;
        System.out.println(d); //11
        ++d;
        System.out.println(d); //12
        System.out.println(d++); //12    13
        System.out.println(++d); //14

        /**
         * 赋值运算符  =    +=   -=   *=    /=   %=
         */
        int j = 10;
        System.out.println(j += 2); //相当于 j=j+2;
        System.out.println(j -= 3); //j = j - 3;
        System.out.println(j *= 4); //j = j * 4;
        System.out.println(j /= 5); //j = j / 5;
        System.out.println(j %= 6); //j = j % 6;

        /**
         * 关系运算符  >    <      >=      <=       !=      ==
         * 关系运算符   结果：boolean类型
         */
         a = 10;
         b = 20;
        System.out.println(a > b);
        System.out.println(a >= b);
        System.out.println(a < b);
        System.out.println(a <= b);
        System.out.println(a == b);
        System.out.println(a != b);
    }
}
